/*
 * PopupUserMessageWrapper.hpp
 *
 *  Created on: May 11, 2012
 *      Author: guillou
 */

#ifndef POPUPUSERMESSAGEWRAPPER_HPP_
#define POPUPUSERMESSAGEWRAPPER_HPP_

#include <PopupLibTypes.hpp>
#include "PopupAbstractMessage.hpp"

namespace Popup
{
  struct UserMessageWrapper : public AbstractMessage, public UserMessage
  {
    enum
    {
      ID,
      SENDER,
      THREAD,
      TARGETS,
      TEXT,
      TITLE,
      URLS,
      ATTACHMENT_IDS
    };

    //! Constructor used in order to send a message
    UserMessageWrapper(const UserMessage & p_message) :
      AbstractMessage(POPUP_MSG_TYPE_MESSAGE), message(p_message) {}

    //! Constructor used in order to receive a message
    UserMessageWrapper(const Message *p_message);

    virtual ~UserMessageWrapper() {}

    //!@Override
    bool onSend();

    //!@Override
    bool onReceive();

  public:
    std::set<AttachmentID> attachmentIDs;

  private:
    UserMessage message;
  };
}

#endif /* POPUPUSERMESSAGEWRAPPER_HPP_ */
